import type { VNodeChild } from "vue";
import type {
  RouteComponent,
  RouteMeta,
  RouteRecordRaw,
  RouteRecordRedirectOption
} from "vue-router";

type Lazy<T> = () => Promise<T>;
export interface AppRouteRecordMeta {
  hideInMenu?: boolean;
  icon?: string | VNodeChild | JSX.Element;
  authority?: string | string[];
  title?: string;
}

export type AppRouteRecordRaw = {
  path: string;
  name?: string;
  children?: AppRouteRecordRaw[];
  meta?: AppRouteRecordMeta & RouteMeta;
  redirect?: RouteRecordRedirectOption;
  component?: RouteComponent | Lazy<RouteComponent>;
} & RouteRecordRaw;
